<!--
 * @Date: 2023-10-12 15:21:19
 * @Description: 首页
 * @LastEditors: hujingyang
 * @Author: hujingyang
 * @FilePath: \xunku_official_website\src\pages\Index\indexPage.vue
 * @IDE: Created by VScode.
-->
<template>
  <div>
    <BannerComponent
      :banner="banner"
      gradientColorStart="#8fc4f8"
      gradientColorEnd="#375bbc"
      aria-label="头部banner图"
    />

    <div class="function-card">
      <div
        v-for="(item, index) in functionCard"
        :key="index"
        class="card-item"
        :style="`background-image:url(${item.icon})`"
      >
        <div class="item-title">{{ item.title }}</div>
        <div class="item-content">{{ item.content }}</div>
      </div>
    </div>

    <LittleTitleComponent
      primaryTitle="其他服务"
      secondTitle="OTHER SERVICES"
      aria-label="模块标题"
      style="height: 140px"
    />

    <div class="other-services">
      <div class="other-services-content">
        <div
          v-for="(item, index) in otherServices"
          :key="index"
          class="content-item"
          :class="{
            contentTextLargeWidth: !index,
            contentTextOtherBg: index === 3,
          }"
        >
          <img
            :src="item.image"
            alt="功能简图"
            v-if="item.image"
            class="item-img"
          />
          <div v-else class="item-text">
            <div
              :class="{
                itemTextWhite: index === 3,
              }"
            >
              {{ item.title }}
            </div>
            <div
              :class="{
                itemTextWhite: index === 3,
                textAlignCenter: item?.describe?.length <= 12,
              }"
            >
              {{ item.describe }}
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import { reactive, ref, toRefs } from "vue";
export default {
  setup() {
    const state = reactive({
      // 首页顶部图
      banner:
        "https://hjy-test09.oss-cn-beijing.aliyuncs.com/20231012%E5%B7%A1%E5%BA%93%E5%AE%98%E7%BD%91/01.Index/banner_1%40960x231.png",
      // 主要服务卡片
      functionCard: [
        {
          title: "库存审计",
          content: "对授信客户、监管方及抵/质押物进行巡查",
          icon: "https://hjy-test09.oss-cn-beijing.aliyuncs.com/20231012%E5%B7%A1%E5%BA%93%E5%AE%98%E7%BD%91/01.Index/banner_inside_1%40185x112.png",
        },
        {
          title: "核库",
          content: "对抵/质押物及监管场地是否符合授信出账要求进行实地核查",
          icon: "https://hjy-test09.oss-cn-beijing.aliyuncs.com/20231012%E5%B7%A1%E5%BA%93%E5%AE%98%E7%BD%91/01.Index/banner_inside_2%40185x112.png.png",
        },
        {
          title: "贷后走访",
          content: "对客户进行现场巡查和贷后信息收集",
          icon: "https://hjy-test09.oss-cn-beijing.aliyuncs.com/20231012%E5%B7%A1%E5%BA%93%E5%AE%98%E7%BD%91/01.Index/banner_inside_3%40185x112.png.png",
        },
      ],
      /**其他服务卡片 */
      otherServices: [
        {
          title: "库存盘点审计",
          describe: "抵/质押物盘点；客户、监管方巡查",
          image: "",
        },
        {
          title: "",
          describe: "",
          image:
            "https://hjy-test09.oss-cn-beijing.aliyuncs.com/20231012%E5%B7%A1%E5%BA%93%E5%AE%98%E7%BD%91/01.Index/banner_inside_1%40145x145.png",
        },
        {
          title: "系统运营",
          describe: "业务运营数据分析",
          image: "",
        },
        {
          title: "解决方案",
          describe: "汽车金融业务链条上完整的数字化服务及解决方案",
          image: "",
        },
        {
          title: "",
          describe: "",
          image:
            "https://hjy-test09.oss-cn-beijing.aliyuncs.com/20231012%E5%B7%A1%E5%BA%93%E5%AE%98%E7%BD%91/01.Index/banner_inside_2%40145x145.png.png",
        },
        {
          title: "智能监控",
          describe: "车辆、客户、行为监控分析",
          image: "",
        },
        {
          title: "软件开发",
          describe: "系统设计、开发、部署、运维",
          image: "",
        },
      ],
    });

    function test() {
      console.log("test");
    }
    return {
      ...toRefs(state),
      test,
    };
  },
};
</script>

<style scoped lang="scss">
.function-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 580px;
  height: 112px;
  z-index: 1;
  margin: -48px auto 0 auto;
  .card-item {
    width: calc(185px - 19px * 2);
    height: calc(112px - 26px - 36px);
    background: #ffffff;
    box-shadow: 0px 2px 3px 1px rgba(251, 184, 79, 0.1);
    border-radius: 5px;
    background-size: 100% 100%;
    padding: 26px 19px 36px 19px;

    &:hover {
      box-shadow: 0 4px 16px 0 rgba(209, 220, 232, 0.63);
    }

    .item-title {
      font-size: 16px;
      color: #434343;
      font-weight: bold;
      font-family: Source Han Sans CN-Medium, Source Han Sans CN;
    }

    .item-content {
      font-size: 10px;
      font-family: Source Han Sans CN-Regular, Source Han Sans CN;
      font-weight: 400;
      color: #8d8d8d;
      margin-top: 8px;
    }
  }
}
.other-services {
  width: 100%;
  height: 363px;
  background-image: url("https://hjy-test09.oss-cn-beijing.aliyuncs.com/20231012%E5%B7%A1%E5%BA%93%E5%AE%98%E7%BD%91/01.Index/content_1%40960x363.png");
  background-size: 100% 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 47px;

  .other-services-content {
    display: flex;
    width: 606px;
    height: 300px;
    flex-wrap: wrap;

    .content-item {
      width: 145px;
      height: 145px;
      background-color: #fff;
      display: flex;
      margin-left: 6px;

      .item-img {
        width: 100%;
        height: 100%;
      }

      .item-text {
        margin: auto;
        width: 122px;
        height: 61px;
        & div:first-child {
          font-size: 16px;
          font-family: Source Han Sans CN-Medium, Source Han Sans CN;
          font-weight: 500;
          color: #000000;
          line-height: 25px;
          text-align: center;
        }

        & div:last-child {
          font-size: 10px;
          font-family: Source Han Sans CN-Regular, Source Han Sans CN;
          font-weight: 400;
          color: #8d8d8d;
          line-height: 14px;
          text-align: left;
          margin-top: 8px;
        }
        .itemTextWhite {
          color: #fff !important;
        }
        .textAlignCenter {
          text-align: center !important;
        }
        & div:last-child.itemTextWhite {
          color: #f0f0f0 !important;
        }
      }

      &:hover {
        box-shadow: 0 4px 16px 0 rgba(209, 220, 232, 0.63);
      }
    }

    .content-item.contentTextLargeWidth {
      width: 296px;
      .item-text {
        width: 162px;
      }
    }
    .content-item.contentTextOtherBg {
      background-color: #6d9ce1;
    }
  }
}
</style>
